/*
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (C) 2017 Andes Technology Corporation
 * Copyright, 2024 Shandong Exponent Semiconductor CO., Ltd.            
 * Copyright, 2024 Sansec Technology CO., Ltd.                          
 *                     All Rights Reserved   
 *
 */
#ifndef __DCF_L2C_HPM_H__
#define __DCF_L2C_HPM_H__

#include <sbi/sbi_types.h>

#define SBI_PMU_FW_L2C_ACCESSES SBI_PMU_FW_MAX
#define SBI_PMU_FW_L2C_ACCESS_MISSES (SBI_PMU_FW_MAX + 1)

int evalsoc_fw_event_validate_code(uint32_t event_idx_code);
bool evalsoc_fw_counter_match_code(uint32_t counter_index,
				 uint32_t event_idx_code);
uint64_t evalsoc_fw_counter_read_value(uint32_t counter_index);
int evalsoc_fw_counter_start(uint32_t counter_index, uint32_t event_idx_code,
			   uint64_t init_val, bool init_val_update);
int evalsoc_fw_counter_stop(uint32_t counter_index);

#endif /* __DCF_L2C_HPM_H__ */
